/**
 * Created by liguangsong on 16/8/4.
 */
import React from 'react'
import { Link, hashHistory } from 'react-router'

var TeamRankInfo = React.createClass( {
    render() {
        var imgString = (this.props.imgName).toLowerCase();
        var imgStr = "app/assist/teamIcon/" +  imgString + ".png";

        //console.log(link);

        return (
            <div onClick={this.handleClick} className="teamRankInfoView" style={{ background: this.props.backColor }}>
                <p className="teamRankName">{this.props.city}</p>
                <p className="teamRankTeam">{this.props.name}</p>
                <p className="teamRank">{this.props.rank}</p>

                <p className="teamRankMark">{this.props.mark}</p>
                <img className="teamRankIcon" src={imgStr} />

            </div>
        )
    },
    handleClick(event) {
        event.preventDefault();
        var imgString = (this.props.imgName).toLowerCase();
        var link = "/Team/" + this.props.name + "/" + this.props.city + '/' + imgString + '/' + this.props.mark + '/' + this.props.conference + '/' + this.props.division + '/' + this.props.ppg + '/' + this.props.rpg + '/' + this.props.apg + '/' + this.props.oppg + '/' + this.props.conferemceRank + '/' + this.props.divisionRank + '/' + this.props.teamId;
        hashHistory.push(link);
    }
});

export default TeamRankInfo;